<?php
	require '../config/config.php';
	session_start();
	$ConfigSql="select * from config where id='1'";
	$ConfigInfo=mysqli_query($con,$ConfigSql);
	$ConnfigRs=mysqli_fetch_array($ConfigInfo);
	if(empty($_SESSION['member'])){
	    echo "<script>location='../index.php';</script>";
	}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo $ConnfigRs['name'];if($ConnfigRs['title']!=""){echo " - ".$ConnfigRs['title'];}?></title>
<style>
	body{margin:0;font-family:'Microsoft YaHei';background:url('../images/bg.png');}
	.box{width:1001px;margin:0 auto;}
	.top{height:179px;background:url('<?php echo $ConnfigRs['banner'];?>');position:relative;}
	.title{padding-left:60px;color:#000;font-size:40px;letter-spacing:5px;line-height:160px;}
	.nav{position:absolute;right:0;bottom:6px;}
	.nav a{color:#000;padding:6px 12px;background:#9cb945;text-decoration:none;}
	.nav a:hover{color:#fff;}
	.main{padding-bottom:10px;background:#fff;color:#333;}
	.news-edit{width:80%;margin:0 auto;padding-top:20px;}
	.news-edit th{width:80px;font-weight:normal;vertical-align:top;padding-bottom:10px;}
	.news-edit td{padding-bottom:10px;}
	.news-edit input[type=text]{width:60%;border:1px solid #A2BBEA;padding:4px;border-radius:5px;font-family:'simsun';}
	.news-edit input[type=text]:hover{background:#eeeeff;}
	.news-edit input[type=password]{width:60%;border:1px solid #A2BBEA;padding:4px;border-radius:5px;font-family:'simsun';}
	.news-edit input[type=password]:hover{background:#eeeeff;}
	.news-edit input[type=submit]{padding:5px 12px;cursor:pointer;}
	.news-edit button{padding:5px 12px;cursor:pointer;}
</style>
</head>
<body>
<div class="box">
	<div class="top">
		<div class="title"><?php echo $ConnfigRs['name'];?></div>
		<div class="nav">
			<a href="../index.php">返回首页</a>
		</div>
	</div>
	<div class="main">
	    <br />&nbsp;&nbsp;&nbsp;<a href="../index.php">首页</a> / 我的订单
		<form method="post">
			<table class="news-edit">
			    <?php
			        if(!empty($_GET['id'])){
                    	$info=mysqli_query($con,"select * from orderRecord where feedbackid='".$_GET['id']."' order by id asc");
                	}else{
                	    $info=mysqli_query($con,"select * from orderRecord order by id asc");
                	}
		    		while($rs=mysqli_fetch_array($info)){?>
		    		    <tr>
        					<th>订单编号：</th>
        					<td><a href="JavaScript:alert('订单编号：<?php echo $rs['bno'];?>');">查看订单</a></td>
        					<th>生成时间：</th>
        					<td><a href="JavaScript:alert('生成时间：<?php echo $rs['cdate'];?>');">查看时间</a></td>
        					<th>订单状态：</th>
        					<td>
        					    <?php 
        					        if($rs['state']=="-1"){
        					            echo "已作废";
        					        }elseif($rs['state']=="0"){
        					            echo "<font color='red'>待支付</font>";
        					        }elseif($rs['state']=="1"){
        					            echo "已支付";
        					        }elseif($rs['state']=="2"){
        					            echo "挂账";
        					        }else
        					    ?>
        					</td>
        					<th>关联工单：</th>
        					<td><a href="https://edu.yudur.cn/feedback/show.php?id=<?php echo $rs['feedbackid'];?>">查看工单</a></td>
        				</tr>   
		    	<?php } ?>
			</table>
		</form>
	</div>
</div>
</body>
</html>